Ways of Pausing

======================================

#include <conio.h>

 

       cout << "Press <Enter> to exit";

_getch();

cin.get();  // seems to be better with VS 2019 and forward so far!

======================================

 

system("pause");

 

======================================

/* Pausing when starting with Debugging (F5)

Tools, Options, Debugging, General, (scroll to bottom of General Window), check or uncheck as desired "Automatically close the console when debugging stops"

 

======================================

 

/* Pausing when starting without Debugging (Ctrl-F5)

Open your project and navigate to the following menu: Project -> YourProjectName Properties -> Configuration Properties -> Linker -> System. There in the field SubSystem use the drop-down to select Console (/SUBSYSTEM:CONSOLE) and apply the change.
"Start without debugging" should do the right thing now.

 

======================================

 

 

References:

https://stackoverflow.com/questions/4118073/how-to-stop-console-from-closing-on-exit/4118093